package jinyilw.swing.visuals;

import javax.swing.JProgressBar;

import jinyilw.swing.i18n.ICSetting;

public class ProgressWindow extends PopWindow // 进度窗
{
	private static final long serialVersionUID = -1620527224948235771L;
	private JProgressBar progressBar;

	public ProgressWindow()
	{
		super();
		initGUI();
	}

	public ProgressWindow(String infoText)
	{
		super(infoText);
		initGUI();
	}

	public ProgressWindow(ICSetting infoText)
	{
		super(infoText);
		initGUI();
	}

	private void initGUI()
	{
		progressBar = new JProgressBar();
		progressBar.setStringPainted(true);
		progressBar.setBounds(0, getHeight() - 20, getWidth(), 15);
		add(progressBar);
		setClickDispose(false);
	}

	@Override
	public void setBounds(int x, int y, int width, int height)
	{
		super.setBounds(x, y, width, height);
		if (progressBar != null)
			progressBar.setBounds(0, height - 20, width, 15);
	}

	public void setValue(int n)
	{
		progressBar.setValue(n);
	}
}
